package org.gtiles.components.login.authentication.impl;

import java.io.Serializable;

import org.gtiles.components.login.authentication.IAuthenticatedUser;

/**
 * 已授权的用户对象，该对象只包含用户的登录ID，用户名及角色。注：此处的角色为Spring Security角色，非业务角色
 * 
 * @author LiuHG
 * @version 1.0
 */
public class AuthenticatedUserImpl implements IAuthenticatedUser,Serializable {

	private static final long serialVersionUID = -7044837867554106829L;
	
	private String entityID;
	private String loginID;
	private String[] userRoles;
	private String password;
	private String name;// 姓名
	private String userName;// 登录名
	private String nickName;// 昵称

	private Object extendAccountInfo;

	public Object getExtendAccountInfo() {
		return extendAccountInfo;
	}

	public void setExtendAccountInfo(Object extendAccountInfo) {
		this.extendAccountInfo = extendAccountInfo;
	}

	// public AuthenticatedUserImpl(){}
	//
	// public AuthenticatedUserImpl(String loginID){
	// this.loginID = loginID;
	// }

	public AuthenticatedUserImpl(String loginID, String name, String password) {
		this.loginID = loginID;
		this.name = name;
		this.password = password;
	}

	public AuthenticatedUserImpl(String entityID, String loginID, String name, String password) {
		this.entityID = entityID;
		this.loginID = loginID;
		this.name = name;
		this.password = password;
	}

	public String getLoginID() {
		return loginID;
	}

	public void setLoginID(String loginID) {
		this.loginID = loginID;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String[] getUserRoles() {
		return userRoles;
	}

	public void setUserRoles(String[] userRoles) {
		this.userRoles = userRoles;
	}

	public String getEntityID() {
		return entityID;
	}

	@Override
	public String getPassword() {
		return this.password;
	}

	@Override
	public void setPassword(String password) {
		this.password = password;

	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getNickName() {
		return nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

}
